﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Cinemon.MySqlConnect;

public partial class Home : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
		List<string> movieNames = new List<string> { };

		List<int> scores = new List<int> { };

		using (DatabaseManager manager = new DatabaseManager()) {
			DataTable table = manager.ExecuteQuery("TopMovie5");

			foreach (DataRow row in table.Rows) {
				scores.Add(int.Parse(row[0].ToString()));
				movieNames.Add(row[1].ToString());
			}
		}

		Chart1.Series[0].Points.DataBindXY(movieNames, scores);
		Chart1.Series[0].BackImageTransparentColor = System.Drawing.Color.Aqua;
		Chart1.Width = 800;
    }
}